package Java2;

import java.util.*;


public class Arraysort {

	public static void main(String[] args)
	{
		int temp;
		Scanner input = new Scanner(System.in);
		boolean flag = true;
		System.out.println("Enter the Number of Array");
		int num = input.nextInt(); 
		
		int[] myarray = new int[num];
		System.out.println("Enter the Values of Array");

		for(int i=0;i<myarray.length;i++)
		{
			myarray[i] = input.nextInt();
		}
	
			for(int i=0;i<myarray.length-1;i++)
			{
				if(myarray[i] > myarray[i+1])
				{
					temp = myarray[i+1];
					myarray[i+1] = myarray[i];
					myarray[i] = temp;

				}

			}
			System.out.println("Sorted Array is");

		for(int i=0;i<myarray.length;i++)
		{
			System.out.println(myarray[i]);

		}

	}
}
